<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
        1.直接遍历 （打印）
        2，for 循环遍历
        3.根据索引号的长度来获取
        4. for-of
        语法：
            for（let 变量名 of arr数组名）{
                console.log(变量名)
            }
  
        5.for—in
         for（let 变量名 in arr数组名）{
                console.log(变量名，数组索引号)
            }
            
        6.forEach 遍历数组
         arr.forEach（function（元素，索引号，数组）{
                console.log(元素，索引，数组)
            })

        */
        let arr = ['大牛', 12, 13, 14, true];
        for (let itme of arr) {
            console.log(itme);
        }
        for (let index in arr) {
            console.log(index, arr[index]);//带索引号的遍历
        }

    </script>
</body>

</html>